<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <link href="/Public/Admin/css/form.css" rel="stylesheet" />
    <style>

    </style>
</block>
<block name="content" > 
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <p class="nav-title">
                    <!--<a class="newsAdd_btn" title="返回" href="javascript:history.go(-1)"><img src="/Public/Admin/images/back.png" /></a>-->
                    <a href="{:U('Flow/lists')}"><span>我的流程</span></a> &nbsp;> &nbsp;
                    <a href="{:U('Flow/index')}"><span>选择流程</span></a> &nbsp;> &nbsp;流程表单
                </p>
                <!--startprint-->
                <div class="cont">
                    <div>
                        <img class="pointer print" src="/Public/Admin/images/print.png" style="float:right;margin:10px 20px;"/>
                    </div>
                    <p style="clear: both"></p>
                    <div class="form-cont form" style="margin-left:10px;">
                        {$form.print_model}
                    </div>
                    <notempty name="uploads[0].name">
                        <div class="uploadFile showFeed">
                            <div class="line feed1">公共附件</div>
                            <div class="feed2">
                                <foreach name="uploads" item="row" key="key">
                                    <span style="display:block;padding:0.5em 0 0.3em 0">
                                        <a href="{$row.upload}" download="{$row.name}">{$key+1}. {$row.name}</a>
                                        <!--<img src="/Public/Index/img/close.png" class="pointer delfile" data-fileurl="{$row.upload}"/>-->
                                    </span>
                                </foreach>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </notempty>
                    <!--会签与点评-->
                    <div class="feedback showFeed">
                        <div class="line feed1">会签与点评</div>
                        <div class="feed2">
                            <foreach name="feeds" item="feed">
                                <div class="f_div">
                                    <div class="f_tit">第{$feed.prcs_id}步【会签】 {$feed.prcs_name} {$feed.user_id|getChinesename}</div>
                                    <div class="f_con">{$feed.content} {$feed.edit_time}</div>
                                </div>
                            </foreach>
                        </div>
                    </div>
                    <div class="clear"></div>

                    <!--流程图-->
                    <div class="feedback showFeed">
                        <div class="line feed1">流程图</div>
                        <table class="feed2">
                            <foreach name="process" item="row">
                                <notempty name="row.data">
                                    <tr>
                                        <td>第<b><font color="red">{$row.id}</font></b>步</td>
                                        <td>序号{$row.prcs_id}：{$row.prcs_name}</td>
                                        <td>
                                    <foreach name="row.data" item="row1">
                                        <div class="lists">
                                            <div>
                                                <if condition="$row1[prcs_flag] eq 4">
                                                    <img src="/Public/Index/img/down.png">
                                                    <elseif condition="$row1[prcs_flag] eq 1"/>
                                                    <img src="/Public/Index/img/email-close.png">
                                                    <else/>
                                                    <img src="/Public/Index/img/email-open.png">
                                                </if>
                                                <font color="red">{$row1.user_id|getChineseName} {$row1['op_flag'] ? '主办' : '经办'}</font>
                                                <font color="green">[{$row1.prcs_flag|getFlagname} 
                                                <if condition="$row1['dec'] neq null">
                                                    &nbsp;用时：<if condition="$row1['dec']['day'] neq 0">{$row1['dec']['day']}天</if><if condition="$row1['dec']['hour'] neq 0">{$row1['dec']['hour']}小时</if><if condition="$row1['dec']['min'] neq 0">{$row1['dec']['min']}分</if>{$row1['dec']['sec']}秒
                                                </if>
                                                ]</font>
                                            </div>
                                            <if condition="$row1['prcs_time'] neq null or $row1['deliver_time'] neq null">
                                            <div>开始于：{$row1.prcs_time}</div>
                                            <div>结束于：{$row1.deliver_time}</div>
                                            </if>
                                        </div>
                                    </foreach>
                                    </td>
                                    </tr>
                                </notempty>
                            </foreach>
                        </table>
                    </div>
                    <div class="clear"></div>

                    <input type="hidden" name="FORM_ID" value="{$form_id}">
                    <input type="hidden" name="RUN_ID" value="{$run_id}">
                    <input type="hidden" name="PRCS_ID" value="{$prcs}">
                    <input type="hidden" name="FLOW_ID" value="{$info.flow_id|default=0}">
                    <div class="button">
                    </div>
                </div>
                <!--endprint-->
                <input type="hidden" id="url" value="{:U('getRunData',array('run_id'=>$run_id,'flow_id'=>$flow_id))}">
                <input type="hidden" id="feedbackUrl" value="{:U('getRunData',array('type'=>'feedback','run_id'=>$run_id))}">
                <input type="hidden" id="FormAutoValueUrl" value="{:U('getFormAutoValue',array('flow_id'=>$flow_id))}"/>
                <input type="hidden" id="FormNotNullFieldUrl" value="{:U('getFormNotNullField',array('flow_id'=>$flow_id,'form_id'=>$form_id))}">
            </div>
        </div>

    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/flow.js"></script>
    <script type="text/javascript">
        $(function () {
            $('.form table .text_value span').text('');
        })

//        $(initUpload("{:U(CONTROLLER_NAME.'/upload')}"));
        $(initFormData())

        //打印页面内容
        $('.print').on('click', function () {
            $(this).hide();
            bdhtml = window.document.body.innerHTML;
            sprnstr = "<!--startprint-->";
            eprnstr = "<!--endprint-->";
            prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17); //从开始打印标识之后的内容
            prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
            window.document.body.innerHTML = prnhtml;
            window.print();
            location.reload();
        })
    </script>
</block>
